import http from "./http";

//首页Banner
export const getBanner = () => {
	return http('/user/getBanner')
}

//首页列表
export const getHomeList = () => {
	return http('/user/getHomeList')
}

//获取UUID
export const generateUUID = () => {
	return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
		  const r = Math.random() * 16 | 0;
		  return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
	})
}

//获取带区间的随机数
export const randomInt = (min, max) => {
	return Math.floor(Math.random() *(max-min + 1)) +min;
}

//获取随机数
export const random = () => {
	return Math.random();
}

//登录
export const login = (code) => {
	return http('/login', {code}, 'POST');
}

//获取用户信息
export const getUserInfo = () => {
	return http('/getUserInfo');
}

//游玩项目
export const detailProject = () =>{
	return http('/detail/project');
}

//项目详情
export const projectInfo = (data) =>{
	return http('/project/info', data);
}

//我的喜欢
export const likeList = () =>{
	return http('/like/list');
}